<template>
	<view class="not-empty fboxCol Ycenter Xcenter" :style="{height: notHeight +'px'}">
		<image class="img" src="https://ebc-prod.cdn.benwunet.com/uni-static/img3.5.0/not.png" mode="aspectFill"></image>
		<view class="tit font28 fboxRow Ycenter Xcenter">{{text}}</view>
		<view class="btn fboxRow Ycenter Xcenter font26 color-E8CDA7" v-if="btn" @click="btnClick">{{btn}}</view>
	</view>
</template>

<script>
	export default {
		props:{
			text: {
				type: String,
				default: '暂无相关信息'
			},
			btn:{
				type: String,
				default: ''
			},
			height:{
				type: Number,
				default: 0
			}
		},
		watch:{
			height:{
				handler(val){
					console.log('height',val)
					if(val){
						this.notHeight = val
					}
				}
			}
		},
		data() {
			return {
				notHeight: 0
			}
		},
		created() {
			if(this.height){
				this.notHeight = this.height
			}else{
				uni.getSystemInfo({success:(sys)=>{
					let height = sys.screenHeight
					this.notHeight = height - getApp().globalData.statusBarHeight-100
					console.log(sys,this.notHeight)
				}})
			}
			console.log(this.notHeight)
		},
		methods: {
			btnClick(){
				this.$emit('btn')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.not-empty{}
	.not-empty .img{width: 196rpx;height: 180rpx}
	.not-empty .tit{margin-top: 10rpx; color: var(--contentFontFourColor);}
	.not-empty .btn{ margin: 32rpx auto 0; padding: 0 20rpx; width: 192rpx;height: 56rpx;border-radius: 8rpx;border: 1rpx solid #E8CDA7;}
	.not-empty /deep/ .u-empty__text{margin-top: -60rpx;position: relative;z-index: 6;}
</style>
